<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});

// 登录验证 openid获取 token获取 用户信息保存
$router->get('sessionkey','LoginController@getSessionKey');
$router->get('sessionkeynoinfo','LoginController@getSessionKeyNoinfo');
$router->get('saveinfo','LoginController@saveInfo');

$router->get('custommsg','CustommsgController@getServer');
$router->post('custommsg','CustommsgController@postServer');
$router->post('notes','GiteeController@notes');

// 图书
$router->get('books', 'BookController@index');
$router->post('books', 'BookController@store');
$router->get('books/{id}', 'BookController@show');

$router->post('zeng', 'ZengController@store');

$router->get('keywords', 'KeywordController@index');
$router->post('keywords', 'KeywordController@store');
$router->post('keywords/{id}', 'KeywordController@destroy');

$router->get('comments', 'QuestionCommentsController@getIndex');
$router->post('comments/add', 'QuestionCommentsController@postAdd');
$router->post('comments/praise', 'QuestionCommentsController@postPraise');
$router->post('comments/admindelete', 'QuestionCommentsController@postadminDelete');
$router->post('comments/adminup', 'QuestionCommentsController@postadminUp');
$router->post('comments/adminhidden', 'QuestionCommentsController@postadminHidden');
